﻿@{
    if(Request.IsAuthenticated) {
        ViewBag.LanJsPosition = "450px";
    }
    else {
        ViewBag.LanJsPosition = "50px";
    }
}
    <style type="text/css">
        /*新增样式:modify by skygreen*/
        /*选择中英文*/
        .lang-picker-wrapper {
            position: absolute;
            right: 50px;
            top: 2px;
            z-index: 1000;
        }

        .lang-picker {
            border-radius: 6px;
            color: #ffffff;
            cursor: pointer;
            display: block;
            float: left;
            height: 24px;
            line-height: 12px;
            margin: -2px 0 0 5px;
            overflow: hidden;
            padding: 0 7px;
            position: relative;
        }

        .lang-picker a {
            color: #ffffff;
            display: block;
            line-height: 22px;
            padding: 0 16px 0 20px;
            text-align: left;
            text-decoration: none;
        }    
    </style>
    <script src="@Url.Content("~/Scripts/globalize.js")" type="text/javascript"></script>   
    <script src="@Url.Content("~/Scripts/cultures/globalize.culture." + UtilCultureHelper.GetCurrentCulture() + ".js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.cookie.js")" type="text/javascript"></script>   

    <script type="text/javascript">   
        $(function ()
        {
            Globalize.culture("@UtilCultureHelper.GetCurrentCulture()");
            $('.lang-picker-wrapper').css('right', "@ViewBag.LanJsPosition");
            $(".lang-picker").bind("mouseenter mouseleave", function ()
            {
                $(this).toggleClass('hover');
                var size = $('a', this).size(); // number of links
                var height = $('a', this).height(); // link height
                var start = $(this).hasClass('hover') ? size : 1;
                $(this).stop(true, false).animate({ height: (height + 2) * start }, 150);

            });

            $(".lang-picker a." + Globalize.culture().name.toLowerCase()).prependTo($(".lang-picker"));

            $(".lang-picker a").click(function ()
            {
                if ($(this).hasClass(Globalize.culture().name.toLowerCase()))
                    return false; // do nothing

                $.cookie("_culture", $(this).attr("class"), { expires: 365, path: '/' });
                window.location.reload(); // reload
            });
        });
    </script>  
        
    <div class="lang-picker-wrapper">
        <span class="lang-picker">
	        <a href="javascript:void(0);" class="zh-cn">中文</a>
            <a href="javascript:void(0);" class="en-us">English</a>
        </span>
    </div>
@if(Request.IsAuthenticated) {
    <span>@Html.ActionLink(@Resources.PasswordChange, "ChangePassword", "Account")</span>
    <text>@Resources.WelcomeText <strong>@User.Identity.Name</strong>!
    [ @Html.ActionLink(@Resources.LogOff, "LogOff", "Account") ]</text>
}
else {
    @:[ @Html.ActionLink(@Resources.Logon, "LogOn", "Account") ]
}